package com.zzxy.spring.controller;

import com.zzxy.spring.domain.User;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author aven
 * @description: TODO
 */
public class CommandController implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        ModelAndView mv = new ModelAndView();
        User user = new User();
        user.setUsername(req.getParameter("username"));
        user.setPassword(req.getParameter("password"));
        user.setSex(req.getParameter("sex"));
        user.setBirthday(req.getParameter("birthday"));
        mv.addObject("user", user);
        mv.setViewName("/user/info");
        return mv;
    }
}
